/*
 * @Author: ailin
 * @Date: 2022-12-08 17:22:25
 * @LastEditors: ailin
 * @LastEditTime: 2023-08-24 15:07:51
 * @Description: file content
 * @FilePath: /pay_platform/src/router/index.js
 */
import { createRouter, createWebHashHistory } from "vue-router"
import * as pay from "@/views/ule/index.js"
// 支付设置相关
const payRoutes = [
  {
    path: "/",
    name: "main",
    meta: {
      title: "首页"
    },
    component: () => import("@/views/main.vue")
  },
  {
    path: "/home",
    name: "home",
    meta: {
      title: "首页"
    },
    component: () => import("@/views/home.vue")
  },
  {
    path: "/home2",
    name: "home2",
    meta: {
      title: "首页"
    },
    component: () => import("@/views/home2.vue")
  },
  {
    path: "/pdgl",
    name: "pdgl",
    meta: {
      title: "首页"
    },
    component: () => import("@/views/marquee.vue")
  },
  {
    path: "/validPassword",
    component: pay.validPassword,
    name: "validPassword",
    meta: {
      title: "验证密码"
    }
  }
]
const router = createRouter({
  history: createWebHashHistory(import.meta.env.VITE_WEB_BASE_URL),
  routes: [
    // {
    //   path: "/",
    //   redirect: "/freshHome",
    //   meta: {
    //     title: "首页"
    //   }
    // },
    ...payRoutes
  ]
})
router.beforeEach((to, from, next) => {
  window.document.title = to.meta.title
  next()
})
export default router
